#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Processor Information Class
 *      Represents the system information for the current processor architecture.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "DisposableObjectBase.h"

using namespace System;
using namespace Adaptive::Foundation;

namespace Adaptive
{
	namespace Win32
	{
		/// <summary>
		/// Represents the system information for the current processor architecture.
		/// </summary>
		public ref class ProcessorInformation sealed : public Foundation::DisposableObjectBase
		{
		public:
			/*--------------------------------------------------------------------------------
			 * Constructor / Dispose / Destructor Methods
			 *------------------------------------------------------------------------------*/
			#pragma region Constructor / Dispose / Destructor Methods
			/// <summary>
			/// Initializes a new instance of the class.
			/// </summary>
			/// <remarks>
			/// This is the default constructor.
			/// </remarks>
			ProcessorInformation();
			/// <summary>
			/// Class destructor.
			/// </summary>
			~ProcessorInformation();
			#pragma endregion

			/*--------------------------------------------------------------------------------
			 * Public Properties
			 *------------------------------------------------------------------------------*/
			#pragma region Public Properties
			/// <summary>
			/// Gets the architecture of the system's processor(s).
			/// </summary>
			/// <value>
			/// A <see cref="ProcessorArchitecture"/> enumeration indicating the architecture type.
			/// </value>
			property ProcessorArchitecture Architecture { ProcessorArchitecture get(); }
			/// <summary>
			/// Gets the page size for the processor.
			/// </summary>
			/// <value>
			/// The page size and the granularity of page protection and commitment.
			/// </value>
			property int PageSize { int get(); }
			/// <summary>
			/// Gets the pointer to the lowest memory address accessible to applications and dynamic-link libraries. 
			/// </summary>
			/// <value>
			/// An <see cref="IntPtr"/> value containing the pointer value (memory address).
			/// </value>
			property IntPtr	MinAddress { IntPtr get(); }
			/// <summary>
			/// Gets the pointer to the highest memory address accessible to applications and dynamic-link libraries. 
			/// </summary>
			/// <value>
			/// An <see cref="IntPtr"/> value containing the pointer value (memory address).
			/// </value>
			property IntPtr MaxAddress { IntPtr get(); }
			/// <summary>
			/// Gets the active processor mask representing the set of processors configured into the system.
			/// </summary>
			/// <value>
			/// An integer value containing the bit flags; Bit 0 is processor 0; bit 31 is processor 31.
			/// </value>
			property int ProcessorMask { int get(); }
			/// <summary>
			/// Gets the number of processors in the system.
			/// </summary>
			/// <value>
			/// Number of processors in the system.
			/// </value>
			property int ProcessorCount { int get(); }
			/// <summary>
			/// Gets the processor type.
			/// </summary>
			/// <value>
			/// A <see cref="ProcessorType"/> enumerated value.
			/// </value>
			property ProcessorType TypeOfProcessor { ProcessorType get(); }
			/// <summary>
			/// Gets the system's architecture-dependent processor level.
			/// </summary>
			/// <value>
			/// The processor level value for display purposes.
			/// </value>
			property int ProcessorLevel { int get(); }
			/// <summary>
			/// Gets the architecture-dependent processor revision.
			/// </summary>
			/// <value>
			/// A processor revision value.  Interpreting the value is based on the individual 
			/// processor architecture.  See the <see cref="SYSTEM_INFO"/> structure for more
			/// details.
			/// </value>
			property int ProcessorRevision { int get(); }
			#pragma endregion

		private:
			/*--------------------------------------------------------------------------------
			 * Private Member Declarations
			 *------------------------------------------------------------------------------*/
			#pragma region Private Member Declarations
			ProcessorArchitecture	_architecture;
			int						_pageSize;
			IntPtr					_minAddress;
			IntPtr					_maxAddress;
			int						_processorMask;
			int						_processorCount;
			ProcessorType			_processorType;
			int						_processorLevel;
			int						_processorRevision;
			#pragma endregion
		};
	}
}